package com.platform.core.entity;

import com.platform.comm.entity.IdEntity;
import com.platform.comm.enums.YnEnum;
import com.platform.dto.SysConfTypeDto;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Description: 参数类型实体类
 *
 * @author libin Created on 2019/7/17
 **/
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "ncloud_sys_conf_type")
public class SysConfType extends IdEntity {

    private static final long serialVersionUID = -4532681706943484776L;
    /**
     * 父类别
     */
    @Column(name = "parent_id", length = 36)
    private String parentId;

    /**
     * 类别编码
     */
    @Column(name = "type_code", length = 100, nullable = false)
    private String typeCode;

    /**
     * 完整编码
     */
    @Column(name = "route_code", length = 1024, nullable = false)
    private String route;

    /**
     * 类别名称
     */
    @Column(name = "type_name", length = 64, nullable = false)
    private String typeName;

    /**
     * 类别描述
     */
    @Column(name = "type_desc", length = 1024)
    private String desc;

    /**
     * 类别层级
     */
    @Column(name = "type_level")
    private Integer level;

    /**
     * 排序编号
     */
    @Column(name = "sort_num")
    private Integer sortNum;

    /**
     * 信息状态
     */
    @Column(name = "DELFLAG")
    private YnEnum delFlag;

    public SysConfTypeDto of() {
        SysConfTypeDto sysConfTypeDto = new SysConfTypeDto();
        sysConfTypeDto.setId(getId());
        sysConfTypeDto.setParentId(getParentId());
        sysConfTypeDto.setTypeName(getTypeName());
        sysConfTypeDto.setRoute(getRoute());
        return sysConfTypeDto;
    }
}
